﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
   public class KhachHangObj
    {
        private string _KhachID;

        public string KhachID
        {
            get { return _KhachID; }
            set { _KhachID = value; }
        }
        private string _Hovaten;

        public string Hovaten
        {
            get { return _Hovaten; }
            set { _Hovaten = value; }
        }
        private string _Gioitinh;

        public string Gioitinh
        {
            get { return _Gioitinh; }
            set { _Gioitinh = value; }
        }
        private string _Sodienthoai;

        public string Sodienthoai
        {
            get { return _Sodienthoai; }
            set { _Sodienthoai = value; }
        }
        private string _Email;

        public string Email
        {
            get { return _Email; }
            set { _Email = value; }
        }
        private string _Password;

        public string Password
        {
            get { return _Password; }
            set { _Password = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }

        private string _Diachi;

        public string Diachi
        {
            get { return _Diachi; }
            set { _Diachi = value; }
        }
        
        public KhachHangObj SetValuesFromDataReader(IDataReader reader)
        {
            KhachHangObj obj = new KhachHangObj();
            obj.KhachID = (reader["KhachID"] is DBNull) ? String.Empty : reader["KhachID"].ToString();
            obj.Hovaten = (reader["Hovaten"] is DBNull) ? String.Empty : reader["Hovaten"].ToString();
            obj.Gioitinh = (reader["Gioitinh"] is DBNull) ? String.Empty : reader["Gioitinh"].ToString();
            obj.Sodienthoai = (reader["Sodienthoai"] is DBNull) ? String.Empty : reader["Sodienthoai"].ToString();
            obj.Email = (reader["Email"] is DBNull) ? String.Empty : reader["Email"].ToString();
            obj.Password = (reader["Password"] is DBNull) ? String.Empty : reader["Password"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? String.Empty : reader["Active"].ToString();
            obj.Diachi = (reader["Diachi"] is DBNull) ? String.Empty : reader["Diachi"].ToString();
            return obj;
        }
    }
}
